<?php
namespace Home\Model;
use Think\Model;

class YaoqingModel extends Model {
    //自动完成

     protected $_auto = array (          
          array('create_time','getdate',2,'callback'), //  
          // array('username','getname',3,'callback'),  
          );
public function getdate()
{
	return date("Y-m-d H:i:s",time());  
}
	public function getname($id)
	{
		$user=M("User");
		$username=$user->where('id='.$id)->find();
		return $username['username'];
	}
}